package com.logictech.activity.system.dao.impl;

import com.logictech.activity.system.dao.SystemRoleDao;
import com.logictech.activity.system.entity.SystemRole;
import java.util.List;
import org.jeecgframework.p3.core.utils.common.PageQuery;
import org.jeecgframework.p3.core.utils.common.PageQueryWrapper;
import org.jeecgframework.p3.core.utils.persistence.mybatis.GenericDaoDefault;
import org.springframework.stereotype.Repository;

@Repository("systemRoleDao")
public class SystemRoleDaoImpl extends GenericDaoDefault<SystemRole>implements SystemRoleDao {
	public Integer count(PageQuery<SystemRole> pageQuery) {
		return (Integer) super.queryOne("count", new Object[] { pageQuery });
	}

	@SuppressWarnings("unchecked")
	public List<SystemRole> queryPageList(PageQuery<SystemRole> pageQuery, Integer itemCount) {
		@SuppressWarnings("rawtypes")
		PageQueryWrapper<SystemRole> wrapper = new PageQueryWrapper(pageQuery.getPageNo(), pageQuery.getPageSize(),
				itemCount.intValue(), pageQuery.getQuery());
		return super.query("queryPageList", new Object[] { wrapper });
	}

	@SuppressWarnings("unchecked")
	public List<SystemRole> queryAllRoleList() {
		return super.query("queryAllRoleList", new Object[0]);
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public List<SystemRole> queryRoleList(List<String> roleIds) {
		
		return super.query("queryRoleList", new Object[] { roleIds });
	}
	
}

